package com.drg.center.dao;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.drg.center.entity.DictDiagnosisMainWithoutPO;
import com.drg.center.mapper.DictDiagnosisMainWithoutMapper;
import com.guaike.core.mybatis.plugins.BaseDAO;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class DictDiagnosisMainWithoutDAO extends BaseDAO<DictDiagnosisMainWithoutMapper, DictDiagnosisMainWithoutPO> {

    public DictDiagnosisMainWithoutPO findOneWith(String mainDiagnosisCode, List<String> tableNames) {
        LambdaQueryWrapper<DictDiagnosisMainWithoutPO> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(DictDiagnosisMainWithoutPO::getDiagnosisCode, mainDiagnosisCode);
        queryWrapper.in(DictDiagnosisMainWithoutPO::getWithoutTable, tableNames);
        return getBaseMapper().selectOne(queryWrapper);
    }
}
